//
//  HomeTongueQualityView.m
//  Ginix
//
//  Created by 冯志强 on 2025/2/23.
//

#import "HomeTongueQualityView.h"
#import "HomeTongueComView.h"

@interface HomeTongueQualityView()
@property (nonatomic,strong) HomeTongueComView * nameView;
@property (nonatomic,strong) YYLabel * nameLabel;
@property (nonatomic,strong) YYLabel * infoLabel;
@end

@implementation HomeTongueQualityView

-(instancetype)initWithFrame:(CGRect)frame{
    
    if (self = [super initWithFrame:frame]) {
        [self setSubViewLayout];
    }
    return self;
}

-(void)setSubViewLayout{
    
    [self addSubview:self.nameView];
    [_nameView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.right.equalTo(@0);
        make.height.mas_offset(21 * FMScaleX);
    }];
    [self addSubview:self.infoLabel];
    [_infoLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.nameView.mas_bottom).offset(15 * FMScaleX);
        make.size.mas_offset(CGSizeMake(300 * FMScaleX, 150 * FMScaleX));
        make.centerX.equalTo(@0);
    }];
   
}

-(void)setInfoModel:(HomeAllCheckInfoModel *)infoModel{
    
    
    self.infoLabel.text = infoModel.describe;
    
}

-(HomeTongueComView *)nameView{
    
    if (!_nameView) {
        _nameView = [[HomeTongueComView alloc]init];
        _nameView.nameLabel.text = @"舌象诊断:";

    }
    return _nameView;
}
-(YYLabel *)nameLabel{
    
    if (!_nameLabel) {
        _nameLabel = [[YYLabel alloc]init];
        _nameLabel.font = Regular(13);
        _nameLabel.textColor = RDRGB(0x333333);
        _nameLabel.textContainerInset = UIEdgeInsetsMake(8 * FMScaleX, 8 * FMScaleX, 8 * FMScaleX, 8* FMScaleX);
//        _nameLabel.text = @"剥落苔：舌苔全部或部分剥落，剥落处舌面光滑无苔者，称为剥苔。一般主胃气匮乏，胃阴枯涸或气血两虚，亦是全身虚弱的一种征象。";
        _nameLabel.numberOfLines = 0;
        _nameLabel.backgroundColor = RDRGB(0xF5F2ED);
    }
    return _nameLabel;
}

-(YYLabel *)infoLabel{
    
    if (!_infoLabel) {
        _infoLabel = [[YYLabel alloc]init];
        _infoLabel.font = Regular(13);
        _infoLabel.textColor = RDRGB(0x333333);
        _infoLabel.textContainerInset = UIEdgeInsetsMake(8 * FMScaleX, 8 * FMScaleX, 8 * FMScaleX, 8* FMScaleX);
        _infoLabel.text = @"厚腻苔：厚苔: 不能透过舌苔见到舌体。腻苔:苔质颗粒细腻致密，紧贴舌面，不容易刮掉。厚腻苔是由胃气挟湿浊、痰湿、食滞等邪气熏蒸所致;当痰湿浊邪化热时，还可在苔色上反映出来，如苔黄厚腻，为湿热、痰热、暑温等邪内蕴。";
        _infoLabel.numberOfLines = 0;
        _infoLabel.backgroundColor = RDRGB(0xF5F2ED);
    }
    return _infoLabel;
}


@end
